package com.test;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.thread.ThreadUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.lang.management.ManagementFactory;
import java.util.Date;

/**
 * @author xin.ding
 * @date 2021/2/5 18:15
 */
public class Main {

    private static final Logger logger = LoggerFactory.getLogger(Main.class);

    public static void main(String[] args) {
        String pid = ManagementFactory.getRuntimeMXBean().getName().split("@")[0];

        Console.log("[{}] App Start With Pid {}", DateUtil.dateNew(new Date()), pid);
        logger.info("this is a log info ");

        int i = 0;
        int max = 50;
        while (i < max) {
            logger.info(Thread.currentThread().getName());
            i++;
            ThreadUtil.sleep(10000);
        }
        Console.log("{} End ", DateUtil.dateNew(new Date()));

    }
}
